package com.obrempon.credit.market.sdk.device.http

import com.google.gson.Gson
import com.obrempon.credit.market.sdk.device.ObremponDeviceSycBuilder
import com.obrempon.credit.market.utils.aes.ObremponAesUtil
import com.obrempon.credit.market.utils.log.ObremponLogger

data class ObremponDeviceRequestParams(
    var path: String,
    var app: String = ObremponDeviceSycBuilder.appid,
    var token: String = ObremponDeviceSycBuilder.token,
    var product: String = ObremponDeviceSycBuilder.product,
    var androidId: String = ObremponDeviceSycBuilder.androidId,
    var advertId: String = ObremponDeviceSycBuilder.advertId,
    var type: String? = null,
    var client: String = "ANDROID",
    var appListGzip: String? = null,
    var smsRecordsGzip: String? = null,
    var smsFetchType: String? = null,
    var deviceHardwareGzip: String? = null,
    var deviceStorageGzip: String? = null,
    var deviceWifiGzip: String? = null,
    var deviceBatteryGzip: String? = null,
    var callLogListGzip: String? = null,
    var phoneBooksGzip: String? = null
) {

    fun toEncryptParams(): String {
        path = path.replace("/", "")
        if(path.isBlank()) return ""

        val content = Gson().toJson(this).trim()
        ObremponLogger.i("ASRequestParams aes before：\n$content")

//        val result = ObremponAesUtil.encryptDefault(content)
//        ObremponLogger.i("ASRequestParams aes after：\n$result")
//        return result
        return content
    }
}
